﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.Practices.SPG.Common.ListRepository;

namespace IntelligentDecisioning.SharePoint.Definition.Lists
{
    public class SharePointProjectTaskList: SharePointList
    {

        #region Constants

        public static readonly Guid PRIORITY_GUID = new Guid("a8eb573e-9e11-481a-a8c9-1104a54b2fbd");
        public static readonly Guid STATUS_GUID = new Guid("c15b34c3-ce7d-490a-b133-3f4de8801b76");
        public static readonly Guid PERCENTCOMPLETE_GUID = new Guid("d2311440-1ed6-46ea-b46d-daa643dc3886");
        public static readonly Guid ASSIGNEDTO_GUID = new Guid("53101f38-dd2e-458c-b245-0c236cc13d1a");
        public static readonly Guid TASKGROUP_GUID = new Guid("50d8f08c-8e99-4948-97bf-2be41fa34a0d");
        public static readonly Guid BODY_GUID = new Guid("7662cd2c-f069-4dba-9e35-082cf976e170");
        public static readonly Guid STARTDATE_GUID = new Guid("64cd368d-2f95-4bfc-a1f9-8d4324ecb007");
        public static readonly Guid DUEDATE_GUID = new Guid("cd21b4c2-6841-4f9e-a23a-738a65f99889");
      

        #endregion

        #region Constructors

        public SharePointProjectTaskList()
            :this("Id Project Tasks")
        {
            
        }

        public SharePointProjectTaskList(String name)
            :base(name)
        {
            base.TemplateType = SPListTemplateType.GanttTasks;
        }

        #endregion

        #region Property Mappings

        public override List<FieldToEntityPropertyMapping> GetFieldMappings()
        {
            List<FieldToEntityPropertyMapping> mappings = base.GetFieldMappings();
            mappings.Add(new FieldToEntityPropertyMapping(SharePointProjectTaskList.PRIORITY_GUID, "Priority"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointProjectTaskList.STATUS_GUID, "Status"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointProjectTaskList.PERCENTCOMPLETE_GUID, "PercentComplete"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointProjectTaskList.ASSIGNEDTO_GUID, "AssignedTo"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointProjectTaskList.TASKGROUP_GUID, "TaskGroup"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointProjectTaskList.BODY_GUID, "Body"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointProjectTaskList.STARTDATE_GUID, "StartDate"));
            mappings.Add(new FieldToEntityPropertyMapping(SharePointProjectTaskList.DUEDATE_GUID, "DueDate"));
            return mappings;
        }

        #endregion
    }
}
